package com.bzxhh.spring6.iocxml.ditest;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestEmp {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean-ditest.xml");
        Emp emp = context.getBean("emp", Emp.class);
        emp.work();

        Emp emp2 = context.getBean("emp2", Emp.class);
        emp2.work();

        Dept dept2 = context.getBean("dept", Dept.class);
        dept2.info();

        Emp emp3 = context.getBean("emp3", Emp.class);
        emp3.work();

        ClassPathXmlApplicationContext context1 = new ClassPathXmlApplicationContext("bean-di-array.xml");
        Emp emp1 = context1.getBean("emp", Emp.class);
        emp1.work();
    }
}
